<include file="Public/header"/>
<body class="J_scroll_fixed">
<div class="wrap J_check_wrap">
  <div class="nav">
      <ul class="cc">
          <li <if condition=" !isset($_GET['status']) || $_GET['status']==1 && empty($itemtype) ">class="current"</if>><a href="{:U('Works/classlist', array('cateid'=>$cateid))}">通过列表</a></li>
          <li <if condition=" isset($_GET['status']) && $_GET['status']==0 ">class="current"</if>><a href="{:U('Works/classlist', array('cateid'=>$cateid ,'search'=>1 ,'status'=>0))}">待审核</a></li>
          <li <if condition=" $_GET['status']==2 ">class="current"</if>><a href="{:U('Works/classlist', array('cateid'=>$cateid ,'search'=>1 ,'status'=>2))}">未通过审核</a></li>
      </ul>
  </div>
  <div class="h_a">搜索</div>
  <form method="post" action="{:U('classlist',array('cateid'=>$cateid))}">
  <input type="hidden" value="{$cateid}" name="cateid">
  <input type="hidden" value="1" name="search">
      <input type="hidden" name="status" value="{$statuss}"/>
    <div class="search_type cc mb10">
      <div class="mb10"> 
        <span class="mr20">时间：
        <input type="text" name="start_time" class="input length_2 J_date" value="{$Think.get.start_time}" style="width:80px;">-<input type="text" class="input length_2 J_date" name="end_time" value="{$Think.get.end_time}" style="width:80px;">
         <select class="select_2" name="type" style="width:90px;">
             <option value='1' <if condition=" $type == '1' "> selected</if>>烘焙作品</option>
             <option value='2' <if condition=" $type == '2' "> selected</if>>参考作品</option>
         </select>
        <select class="select_2" name="searchtype" style="width:70px;">
          <option value='1' <if condition=" $searchtype == '1' "> selected</if>>标题</option>
          <option value='2' <if condition=" $searchtype == '2' "> selected</if>>昵称</option>
          <option value='3' <if condition=" $searchtype == '3' "> selected</if>>作品ID</option>
        </select>
        关键字：
        <input type="text" class="input length_2" name="keyword" style="width:200px;" value="{$_GET.keyword}" placeholder="请输入关键字...">
        <button class="btn">搜索</button>
        </span>
      </div>
    </div>
  </form>
    <form class="J_ajaxForm" action="" method="post">
        <div class="table_user">
            <table width="100%">
                <colgroup>
                    <col width="16">
                    <col width="40">
                    <col width="50">
                    <col width="80">
                    <col width="50">
                    <col width="50">
                    <col width="">
                    <col width="100">
                    <col width="100">
                    <col width="100">
                </colgroup>
                <thead>
                <tr>
                    <td><label><input type="checkbox" class="J_check_all" data-direction="x" data-checklist="J_check_x"></label></td>
                    <td><a href="{:U('classlist',array('cateid'=>$cateid,'status'=>$statuss,'order'=>'sort'))}">排序</a></td>
                    <td><a href="{:U('classlist',array('cateid'=>$cateid,'status'=>$statuss,'order'=>'workid'))}">ID</a></td>
                    <td>审核</td>
                    <td><a href="{:U('classlist',array('cateid'=>$cateid,'status'=>$statuss,'order'=>'iftj'))}">推荐</a></td>
                    <td><a href="{:U('classlist',array('cateid'=>$cateid,'status'=>$statuss,'order'=>'ifindex'))}">首页</a></td>
                    <td>标题</td>
                    <td>发布人</td>
                    <td><a href="{:U('classlist',array('cateid'=>$cateid,'status'=>$statuss,'order'=>'create_time'))}">时间</a></td>
                    <td>操作</td>
                </tr>
                </thead>
                <volist name="data" id="vo">
                    <tr>
                        <td><input type="checkbox" class="J_check" data-yid="J_check_y" data-xid="J_check_x" name="ids[]" value="{$vo.workid}"></td>
                        <td><input name='sort[{$vo.workid}]' class="input mr5"  type='text' size='3' value='{$vo.sort}'></td>
                        <td>{$vo.workid}</td>
                        <td>{$vo.status|showPass}</td>
                        <td>{$vo.iftj|showStatus}</td>
                        <td>{$vo.ifindex|showStatus}</td>
                        <td><a href="/{$vo.type|getWorkUrl}/{$vo.workid}" target="_blank">{$vo.title|str_cut=20}</a></td>
                        <td>{$vo.userid|getNickName}</td>
                        <td>{$vo.create_time|date="Y/m/d",###}</td>
                        <td><a href="javascript:void(0)" onClick="javascript:openwinx('{:U("Works/edit",array("workid"=>$vo[workid]))}','')">修改</a> |
                            <a class="J_ajax_del" data-msg="确定删除该产品吗?" href="{:U('Works/delete',array('workid'=>$vo['workid']))}">删除</a></td>
                    </tr>
                </volist>
            </table>
            <div class="p10"><div class="pages"> {$Page} </div> </div>

        </div>
        <div class="btn_wrap">
            <div class="btn_wrap_pd">
                <label class="mr20 sel-all"><input type="checkbox" class="J_check_all" data-direction="y" data-checklist="J_check_y">全选</label>
                <button class="btn J_ajax_submit_btn" type="submit" data-action="{:U('Works/batch_sort')}">排序</button>
                <button class="btn J_ajax_submit_btn" type="submit" data-action="{:U('Works/batch/',array('do'=>'checkpass'))}">审核</button>
                <button class="btn J_ajax_submit_btn" type="submit" data-action="{:U('Works/batch/',array('do'=>'cancelpass'))}">取消审核</button>
                <button class="btn J_ajax_submit_btn" type="submit" data-action="{:U('Works/batch/',array('do'=>'nopass'))}">不通过审核</button>
                <button class="btn J_ajax_submit_btn" type="submit" data-action="{:U('Works/batch/',array('do'=>'checktj'))}">推荐</button>
                <button class="btn J_ajax_submit_btn" type="submit" data-action="{:U('Works/batch/',array('do'=>'canceltj'))}">取消推荐</button>
                <button class="btn J_ajax_submit_btn" type="submit" data-action="{:U('Works/batch/',array('do'=>'checkindex'))}">首页</button>
                <button class="btn J_ajax_submit_btn" type="submit" data-action="{:U('Works/batch/',array('do'=>'cancelindex'))}">取消首页</button>
                <button class="btn J_ajax_submit_btn" type="submit" data-action="{:U('Works/batch_delete')}">删除</button>
            </div>
        </div>
    </form>
</div>
<script src="__JS__/common.js"></script>
<script>
setCookie('refersh_time', 0);
function refersh_window() {
    var refersh_time = getCookie('refersh_time');
    if (refersh_time == 1) {
        window.location.reload();
    }
}
setInterval(function(){
	refersh_window()
}, 3000);
$(function () {
    Wind.use('ajaxForm','artDialog','iframeTools', function () {
        //批量移动
        $('#J_Content_remove').click(function (e) {
            var str = 0;
            var id = tag = '';
            $("input[name='ids[]']").each(function () {
                if ($(this).attr('checked')) {
                    str = 1;
                    id += tag + $(this).val();
                    tag = '|';
                }
            });
            if (str == 0) {
				art.dialog.through({
					id:'error',
					icon: 'error',
					content: '您没有勾选信息，无法进行操作！',
					cancelVal: '关闭',
					cancel: true
				});
                return false;
            }
            var $this = $(this);
            art.dialog.open("{$config_siteurl}index.php?m=Admins&c=Works&a=remove&cateid={$cateid}&ids=" + id, {
                title: "批量移动",
                width: 600
            });
        });
    });
});

function view_comment(obj) {
	Wind.use('artDialog','iframeTools', function () {
         art.dialog.open($(obj).attr("data-url"), {
			close:function(){
				$(obj).focus();
			},
            title: $(obj).attr("data-title"),
			width:"800px",
            height: '520px',
			id:"view_comment",
            lock: true,
            background:"#CCCCCC",
            opacity:0
        });
    });
}

function pushs() {
    $("form").submit(function () {
        return false;
    });
    var str = 0;
    var id = tag = '';
    $("input[name='ids[]']").each(function () {
        if ($(this).attr('checked')) {
            str = 1;
            id += tag + $(this).val();
            tag = '|';
        }
    });
    if (str == 0) {
       art.dialog({
		   id:'error',
		   icon: 'error',
		   content: '您没有勾选信息，无法进行操作！',
		   cancelVal: '关闭',
		   cancel: true
		});
        return false;
    }
    Wind.use('artDialog','iframeTools', function () {
         art.dialog.open("{$config_siteurl}index.php?g=Content&m=Content&a=push&action=position_list&modelid={$modelid}&catid={$catid}&id=" + id, {
            title: "信息推送"
        });
    });
}
</script>
</body>
</html>